package comment

import (
	"github.com/astaxie/beego/orm"
	"time"
)

type Comment struct {
	Id int `orm:"pk;auto;description(主键)"`
	ParentId int `orm:"description(评论父级id)"`
	ArticleId int `orm:"description(文章ID)"`
	UserId int `orm:"description(用户ID)"`
	Uname string `orm:"size(60);description(评论人姓名)"`
	ToUid int `orm:"description(被评论的用户id)"`
	Content string `orm:"size(500);description(评论内容)"`
	IsDelete int `orm:"default(0);description(1删除，0未删除)"`
	CreateTime time.Time `orm:"auto_now;type(datetime);description(创建时间);null"`
}

func (c *Comment) TableName() string{
	return "sys_comment"
}

func init()  {
	orm.RegisterModel(new(Comment))
}